import 'package:flutter/material.dart';
import 'package:lib_uikit/lib_uikit.dart';

class GTNotificationWidgetV3 extends StatelessWidget {
  final String title;
  final String content;
  final VoidCallback? onCloseClick;
  const GTNotificationWidgetV3({
    super.key,
    required this.title,
    required this.content,
    this.onCloseClick,
  });

  @override
  Widget build(BuildContext context) {
    Widget _child() {
      return Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Padding(
            padding: EdgeInsets.only(top: 12),
            child: Icon(
              GTIconFont.e938,
              size: 16,
              color: GTColorsV3.icon1.color,
            ),
          ),
          const SizedBox(
            width: 8,
          ),
          Expanded(
              child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              const SizedBox(
                height: 12,
              ),
              Text(
                title,
                style: gtTextStyleW700(fontSize: 14, color: GTColorsV3.text1.color),
              ),
              const SizedBox(
                height: 8,
              ),
              Text(
                content,
                style: gtTextStyleW500(fontSize: 12, color: GTColorsV3.text1.color),
              ),
            ],
          )),
          const SizedBox(
            width: 16,
          ),
          GestureDetector(onTap: (){
            if(onCloseClick!=null){
              onCloseClick!();
            }
          },
          child: Padding(
            padding: const EdgeInsets.all(8),
            child: Icon(
              GTIconFont.e95d,
              size: 12,
              color: GTColorsV3.icon3.color,
            ),
          ),)

        ],
      );
    }

    return Container(
        margin: const EdgeInsets.symmetric(horizontal: 12),
        padding: GTEdgeInsetsFormRTLB(12, 0, 0, 12),
        decoration: BoxDecoration(
          color: GTColorsV3.cmpt16.color,
          border: Border.all(
            color: GTColorsV3.divider2.color,
            width: 0.5,
          ),
          borderRadius: BorderRadius.circular(6),
          boxShadow: const [
            BoxShadow(
              color: Color(0x14000000),
              blurRadius: 14,
              offset: Offset(0, 2),
            ),
          ],
        ),
        child: _child());
  }
}
